3.2.13 \(\int f^{a+b x} \cos (d+e x+f x^2) \, dx\) [113]

Optimal. Leaf size=162 \[ -\frac {1}{4} \sqrt [4]{-1} e^{\frac {1}{4} i \left (4 d+\frac {(i e+b \log (f))^2}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {Erf}\left (\frac {\sqrt [4]{-1} (i e+2 i f x+b \log (f))}{2 \sqrt {f}}\right )-\frac {1}{4} \sqrt [4]{-1} e^{-i d+\frac {i (e+i b \log (f))^2}{4 f}} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {Erfi}\left (\frac {\sqrt [4]{-1} (i e+2 i f x-b \log (f))}{2 \sqrt {f}}\right ) \]

[Out]

-1/4*(-1)^(1/4)*exp(1/4*I*(4*d+(I*e+b*ln(f))^2/f))*f^(-1/2+a)*erf(1/2*(-1)^(1/4)*(I*e+2*I*f*x+b*ln(f))/f^(1/2)
)*Pi^(1/2)-1/4*(-1)^(1/4)*exp(-I*d+1/4*I*(e+I*b*ln(f))^2/f)*f^(-1/2+a)*erfi(1/2*(-1)^(1/4)*(I*e+2*I*f*x-b*ln(f
))/f^(1/2))*Pi^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.20, antiderivative size = 162, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {4561, 2325, 2266, 2235, 2236} \begin {gather*} -\frac {1}{4} \sqrt [4]{-1} \sqrt {\pi } f^{a-\frac {1}{2}} e^{\frac {1}{4} i \left (4 d+\frac {(b \log (f)+i e)^2}{f}\right )} \text {Erf}\left (\frac {\sqrt [4]{-1} (b \log (f)+i e+2 i f x)}{2 \sqrt {f}}\right )-\frac {1}{4} \sqrt [4]{-1} \sqrt {\pi } f^{a-\frac {1}{2}} e^{\frac {i (e+i b \log (f))^2}{4 f}-i d} \text {Erfi}\left (\frac {\sqrt [4]{-1} (-b \log (f)+i e+2 i f x)}{2 \sqrt {f}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[f^(a + b*x)*Cos[d + e*x + f*x^2],x]

[Out]

-1/4*((-1)^(1/4)*E^((I/4)*(4*d + (I*e + b*Log[f])^2/f))*f^(-1/2 + a)*Sqrt[Pi]*Erf[((-1)^(1/4)*(I*e + (2*I)*f*x
 + b*Log[f]))/(2*Sqrt[f])]) - ((-1)^(1/4)*E^((-I)*d + ((I/4)*(e + I*b*Log[f])^2)/f)*f^(-1/2 + a)*Sqrt[Pi]*Erfi
[((-1)^(1/4)*(I*e + (2*I)*f*x - b*Log[f]))/(2*Sqrt[f])])/4

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 2266

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2325

Int[(u_.)*(F_)^(v_)*(G_)^(w_), x_Symbol] :> With[{z = v*Log[F] + w*Log[G]}, Int[u*NormalizeIntegrand[E^z, x],
x] /; BinomialQ[z, x] || (PolynomialQ[z, x] && LeQ[Exponent[z, x], 2])] /; FreeQ[{F, G}, x]

Rule 4561

Int[Cos[v_]^(n_.)*(F_)^(u_), x_Symbol] :> Int[ExpandTrigToExp[F^u, Cos[v]^n, x], x] /; FreeQ[F, x] && (LinearQ
[u, x] || PolyQ[u, x, 2]) && (LinearQ[v, x] || PolyQ[v, x, 2]) && IGtQ[n, 0]

Rubi steps

\begin {align*} \int f^{a+b x} \cos \left (d+e x+f x^2\right ) \, dx &=\int \left (\frac {1}{2} e^{-i d-i e x-i f x^2} f^{a+b x}+\frac {1}{2} e^{i d+i e x+i f x^2} f^{a+b x}\right ) \, dx\\ &=\frac {1}{2} \int e^{-i d-i e x-i f x^2} f^{a+b x} \, dx+\frac {1}{2} \int e^{i d+i e x+i f x^2} f^{a+b x} \, dx\\ &=\frac {1}{2} \int \exp \left (-i d-i f x^2+a \log (f)-x (i e-b \log (f))\right ) \, dx+\frac {1}{2} \int \exp \left (i d+i f x^2+a \log (f)+x (i e+b \log (f))\right ) \, dx\\ &=\frac {1}{2} \left (e^{-i d+\frac {i (e+i b \log (f))^2}{4 f}} f^a\right ) \int e^{\frac {i (-i e-2 i f x+b \log (f))^2}{4 f}} \, dx+\frac {1}{2} \left (e^{\frac {1}{4} i \left (4 d+\frac {(i e+b \log (f))^2}{f}\right )} f^a\right ) \int e^{-\frac {i (i e+2 i f x+b \log (f))^2}{4 f}} \, dx\\ &=-\frac {1}{4} \sqrt [4]{-1} e^{\frac {1}{4} i \left (4 d+\frac {(i e+b \log (f))^2}{f}\right )} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {erf}\left (\frac {\sqrt [4]{-1} (i e+2 i f x+b \log (f))}{2 \sqrt {f}}\right )-\frac {1}{4} \sqrt [4]{-1} e^{-i d+\frac {i (e+i b \log (f))^2}{4 f}} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {erfi}\left (\frac {\sqrt [4]{-1} (i e+2 i f x-b \log (f))}{2 \sqrt {f}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.40, size = 163, normalized size = 1.01 \begin {gather*} \frac {1}{4} \sqrt [4]{-1} e^{-\frac {i \left (e^2+b^2 \log ^2(f)\right )}{4 f}} f^{a-\frac {b e+f}{2 f}} \sqrt {\pi } \left (-e^{\frac {i e^2}{2 f}} \text {Erfi}\left (\frac {(-1)^{3/4} (e+2 f x+i b \log (f))}{2 \sqrt {f}}\right ) (\cos (d)-i \sin (d))+e^{\frac {i b^2 \log ^2(f)}{2 f}} \text {Erfi}\left (\frac {\sqrt [4]{-1} (e+2 f x-i b \log (f))}{2 \sqrt {f}}\right ) (-i \cos (d)+\sin (d))\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[f^(a + b*x)*Cos[d + e*x + f*x^2],x]

[Out]

((-1)^(1/4)*f^(a - (b*e + f)/(2*f))*Sqrt[Pi]*(-(E^(((I/2)*e^2)/f)*Erfi[((-1)^(3/4)*(e + 2*f*x + I*b*Log[f]))/(
2*Sqrt[f])]*(Cos[d] - I*Sin[d])) + E^(((I/2)*b^2*Log[f]^2)/f)*Erfi[((-1)^(1/4)*(e + 2*f*x - I*b*Log[f]))/(2*Sq
rt[f])]*((-I)*Cos[d] + Sin[d])))/(4*E^(((I/4)*(e^2 + b^2*Log[f]^2))/f))

________________________________________________________________________________________

Maple [A]
time = 0.19, size = 150, normalized size = 0.93

method result size
risch \(-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {i \left (\ln \left (f \right )^{2} b^{2}-2 i \ln \left (f \right ) b e -e^{2}+4 d f \right )}{4 f}} \erf \left (-\sqrt {i f}\, x +\frac {b \ln \left (f \right )-i e}{2 \sqrt {i f}}\right )}{4 \sqrt {i f}}-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{\frac {i \left (\ln \left (f \right )^{2} b^{2}+2 i \ln \left (f \right ) b e -e^{2}+4 d f \right )}{4 f}} \erf \left (-\sqrt {-i f}\, x +\frac {i e +b \ln \left (f \right )}{2 \sqrt {-i f}}\right )}{4 \sqrt {-i f}}\) \(150\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(f^(b*x+a)*cos(f*x^2+e*x+d),x,method=_RETURNVERBOSE)

[Out]

-1/4*Pi^(1/2)*f^a*exp(-1/4*I*(ln(f)^2*b^2-2*I*ln(f)*b*e-e^2+4*d*f)/f)/(I*f)^(1/2)*erf(-(I*f)^(1/2)*x+1/2*(b*ln
(f)-I*e)/(I*f)^(1/2))-1/4*Pi^(1/2)*f^a*exp(1/4*I*(ln(f)^2*b^2+2*I*ln(f)*b*e-e^2+4*d*f)/f)/(-I*f)^(1/2)*erf(-(-
I*f)^(1/2)*x+1/2*(I*e+b*ln(f))/(-I*f)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 189, normalized size = 1.17 \begin {gather*} -\frac {\sqrt {2} \sqrt {\pi } {\left ({\left (-\left (i - 1\right ) \, f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f - e^{2}}{4 \, f}\right ) - \left (i + 1\right ) \, f^{a} \sin \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f - e^{2}}{4 \, f}\right )\right )} \operatorname {erf}\left (\frac {i \, {\left (2 i \, f x - b \log \left (f\right ) + i \, e\right )} \sqrt {i \, f}}{2 \, f}\right ) + {\left (\left (i + 1\right ) \, f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f - e^{2}}{4 \, f}\right ) + \left (i - 1\right ) \, f^{a} \sin \left (\frac {b^{2} \log \left (f\right )^{2} + 4 \, d f - e^{2}}{4 \, f}\right )\right )} \operatorname {erf}\left (\frac {i \, {\left (2 i \, f x + b \log \left (f\right ) + i \, e\right )} \sqrt {-i \, f}}{2 \, f}\right )\right )}}{8 \, \sqrt {f} f^{\frac {b e}{2 \, f}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(f^(b*x+a)*cos(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

-1/8*sqrt(2)*sqrt(pi)*((-(I - 1)*f^a*cos(1/4*(b^2*log(f)^2 + 4*d*f - e^2)/f) - (I + 1)*f^a*sin(1/4*(b^2*log(f)
^2 + 4*d*f - e^2)/f))*erf(1/2*I*(2*I*f*x - b*log(f) + I*e)*sqrt(I*f)/f) + ((I + 1)*f^a*cos(1/4*(b^2*log(f)^2 +
 4*d*f - e^2)/f) + (I - 1)*f^a*sin(1/4*(b^2*log(f)^2 + 4*d*f - e^2)/f))*erf(1/2*I*(2*I*f*x + b*log(f) + I*e)*s
qrt(-I*f)/f))/(sqrt(f)*f^(1/2*b*e/f))

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 321 vs. \(2 (113) = 226\).
time = 2.40, size = 321, normalized size = 1.98 \begin {gather*} \frac {\sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} - 4 i \, d f + 2 \, {\left (2 \, a f - b e\right )} \log \left (f\right ) + i \, e^{2}}{4 \, f}\right )} \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, f x + i \, b \log \left (f\right ) + e\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} + 4 i \, d f + 2 \, {\left (2 \, a f - b e\right )} \log \left (f\right ) - i \, e^{2}}{4 \, f}\right )} \operatorname {C}\left (-\frac {\sqrt {2} {\left (2 \, f x - i \, b \log \left (f\right ) + e\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - i \, \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} - 4 i \, d f + 2 \, {\left (2 \, a f - b e\right )} \log \left (f\right ) + i \, e^{2}}{4 \, f}\right )} \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, f x + i \, b \log \left (f\right ) + e\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) - i \, \sqrt {2} \pi \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} + 4 i \, d f + 2 \, {\left (2 \, a f - b e\right )} \log \left (f\right ) - i \, e^{2}}{4 \, f}\right )} \operatorname {S}\left (-\frac {\sqrt {2} {\left (2 \, f x - i \, b \log \left (f\right ) + e\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right )}{4 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(f^(b*x+a)*cos(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

1/4*(sqrt(2)*pi*sqrt(f/pi)*e^(1/4*(-I*b^2*log(f)^2 - 4*I*d*f + 2*(2*a*f - b*e)*log(f) + I*e^2)/f)*fresnel_cos(
1/2*sqrt(2)*(2*f*x + I*b*log(f) + e)*sqrt(f/pi)/f) - sqrt(2)*pi*sqrt(f/pi)*e^(1/4*(I*b^2*log(f)^2 + 4*I*d*f +
2*(2*a*f - b*e)*log(f) - I*e^2)/f)*fresnel_cos(-1/2*sqrt(2)*(2*f*x - I*b*log(f) + e)*sqrt(f/pi)/f) - I*sqrt(2)
*pi*sqrt(f/pi)*e^(1/4*(-I*b^2*log(f)^2 - 4*I*d*f + 2*(2*a*f - b*e)*log(f) + I*e^2)/f)*fresnel_sin(1/2*sqrt(2)*
(2*f*x + I*b*log(f) + e)*sqrt(f/pi)/f) - I*sqrt(2)*pi*sqrt(f/pi)*e^(1/4*(I*b^2*log(f)^2 + 4*I*d*f + 2*(2*a*f -
 b*e)*log(f) - I*e^2)/f)*fresnel_sin(-1/2*sqrt(2)*(2*f*x - I*b*log(f) + e)*sqrt(f/pi)/f))/f

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int f^{a + b x} \cos {\left (d + e x + f x^{2} \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(f**(b*x+a)*cos(f*x**2+e*x+d),x)

[Out]

Integral(f**(a + b*x)*cos(d + e*x + f*x**2), x)

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 378 vs. \(2 (109) = 218\).
time = 0.46, size = 378, normalized size = 2.33 \begin {gather*} -\frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{8} \, \sqrt {2} {\left (4 \, x - \frac {\pi b \mathrm {sgn}\left (f\right ) - \pi b + 2 i \, b \log \left ({\left | f \right |}\right ) - 2 \, e}{f}\right )} {\left (-\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}\right ) e^{\left (\frac {i \, \pi ^{2} b^{2} \mathrm {sgn}\left (f\right )}{8 \, f} + \frac {\pi b^{2} \log \left ({\left | f \right |}\right ) \mathrm {sgn}\left (f\right )}{4 \, f} - \frac {i \, \pi ^{2} b^{2}}{8 \, f} - \frac {\pi b^{2} \log \left ({\left | f \right |}\right )}{4 \, f} + \frac {i \, b^{2} \log \left ({\left | f \right |}\right )^{2}}{4 \, f} - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {i \, \pi b e \mathrm {sgn}\left (f\right )}{4 \, f} + \frac {1}{2} i \, \pi a - \frac {i \, \pi b e}{4 \, f} + a \log \left ({\left | f \right |}\right ) - \frac {b e \log \left ({\left | f \right |}\right )}{2 \, f} + i \, d - \frac {i \, e^{2}}{4 \, f}\right )}}{4 \, {\left (-\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}} - \frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{8} \, \sqrt {2} {\left (4 \, x + \frac {\pi b \mathrm {sgn}\left (f\right ) - \pi b + 2 i \, b \log \left ({\left | f \right |}\right ) + 2 \, e}{f}\right )} {\left (\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}\right ) e^{\left (-\frac {i \, \pi ^{2} b^{2} \mathrm {sgn}\left (f\right )}{8 \, f} - \frac {\pi b^{2} \log \left ({\left | f \right |}\right ) \mathrm {sgn}\left (f\right )}{4 \, f} + \frac {i \, \pi ^{2} b^{2}}{8 \, f} + \frac {\pi b^{2} \log \left ({\left | f \right |}\right )}{4 \, f} - \frac {i \, b^{2} \log \left ({\left | f \right |}\right )^{2}}{4 \, f} - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {i \, \pi b e \mathrm {sgn}\left (f\right )}{4 \, f} + \frac {1}{2} i \, \pi a - \frac {i \, \pi b e}{4 \, f} + a \log \left ({\left | f \right |}\right ) - \frac {b e \log \left ({\left | f \right |}\right )}{2 \, f} - i \, d + \frac {i \, e^{2}}{4 \, f}\right )}}{4 \, {\left (\frac {i \, f}{{\left | f \right |}} + 1\right )} \sqrt {{\left | f \right |}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(f^(b*x+a)*cos(f*x^2+e*x+d),x, algorithm="giac")

[Out]

-1/4*sqrt(2)*sqrt(pi)*erf(-1/8*sqrt(2)*(4*x - (pi*b*sgn(f) - pi*b + 2*I*b*log(abs(f)) - 2*e)/f)*(-I*f/abs(f) +
 1)*sqrt(abs(f)))*e^(1/8*I*pi^2*b^2*sgn(f)/f + 1/4*pi*b^2*log(abs(f))*sgn(f)/f - 1/8*I*pi^2*b^2/f - 1/4*pi*b^2
*log(abs(f))/f + 1/4*I*b^2*log(abs(f))^2/f - 1/2*I*pi*a*sgn(f) + 1/4*I*pi*b*e*sgn(f)/f + 1/2*I*pi*a - 1/4*I*pi
*b*e/f + a*log(abs(f)) - 1/2*b*e*log(abs(f))/f + I*d - 1/4*I*e^2/f)/((-I*f/abs(f) + 1)*sqrt(abs(f))) - 1/4*sqr
t(2)*sqrt(pi)*erf(-1/8*sqrt(2)*(4*x + (pi*b*sgn(f) - pi*b + 2*I*b*log(abs(f)) + 2*e)/f)*(I*f/abs(f) + 1)*sqrt(
abs(f)))*e^(-1/8*I*pi^2*b^2*sgn(f)/f - 1/4*pi*b^2*log(abs(f))*sgn(f)/f + 1/8*I*pi^2*b^2/f + 1/4*pi*b^2*log(abs
(f))/f - 1/4*I*b^2*log(abs(f))^2/f - 1/2*I*pi*a*sgn(f) + 1/4*I*pi*b*e*sgn(f)/f + 1/2*I*pi*a - 1/4*I*pi*b*e/f +
 a*log(abs(f)) - 1/2*b*e*log(abs(f))/f - I*d + 1/4*I*e^2/f)/((I*f/abs(f) + 1)*sqrt(abs(f)))

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int f^{a+b\,x}\,\cos \left (f\,x^2+e\,x+d\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(f^(a + b*x)*cos(d + e*x + f*x^2),x)

[Out]

int(f^(a + b*x)*cos(d + e*x + f*x^2), x)

________________________________________________________________________________________